package yxy.banana.server.management;

import java.util.Collection;
import java.util.HashMap;

public class Mapped<K, V> {
	private HashMap<K, V> mapping = new HashMap<>();

	public synchronized void map(K key, V value) {
		this.mapping.put(key, value);
	}

	public synchronized V find(K key) {
		return this.mapping.get(key);
	}

	public synchronized V remove(K key) {
		return this.mapping.remove(key);
	}

	public synchronized Collection<V> all() {
		return this.mapping.values();
	}
}
